package com.im.nero.user.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the teacher database table.
 * 
 */
@Entity
@NamedQuery(name="Teacher.findAll", query="SELECT t FROM Teacher t")
public class Teacher implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int id;

	private String district;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="START_DATE")
	private Date startDate;

	//bi-directional one-to-one association to User
	@OneToOne
	@JoinColumn(name="ID")
	private User user;

	//bi-directional many-to-one association to TeacherInstitute
	@OneToMany(mappedBy="teacher")
	private Set<TeacherInstitute> teacherInstitutes;

	public Teacher() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDistrict() {
		return this.district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Set<TeacherInstitute> getTeacherInstitutes() {
		return this.teacherInstitutes;
	}

	public void setTeacherInstitutes(Set<TeacherInstitute> teacherInstitutes) {
		this.teacherInstitutes = teacherInstitutes;
	}

	public TeacherInstitute addTeacherInstitute(TeacherInstitute teacherInstitute) {
		getTeacherInstitutes().add(teacherInstitute);
		teacherInstitute.setTeacher(this);

		return teacherInstitute;
	}

	public TeacherInstitute removeTeacherInstitute(TeacherInstitute teacherInstitute) {
		getTeacherInstitutes().remove(teacherInstitute);
		teacherInstitute.setTeacher(null);

		return teacherInstitute;
	}

}